home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / lightwave / lwmlist / 93.lightwave-00 / 000558_rutgers!well.sf.ca.us!shf_Fri, 30 Jul 93 23:06:44 EDT.msg < prev    next >
Internet Message Format  |  1993-12-31  |  3KB

  1. Received: by bobsbox.rent.com (V1.16/Amiga)
  2.     id AA00000; Fri, 30 Jul 93 23:06:44 EDT
  3. Received: from nkosi.well.sf.ca.us by rutgers.edu (5.59/SMI4.0/RU1.5/3.08) 
  4.     id AA15535; Fri, 30 Jul 93 22:19:31 EDT
  5. Received: from well.sf.ca.us (well.sf.ca.us [192.132.30.2]) by nkosi.well.sf.ca.us (8.5/8.5) with SMTP id TAA21600; Fri, 30 Jul 1993 19:19:20 -0700
  6. Received: by well.sf.ca.us id <14077-2>; Fri, 30 Jul 1993 19:19:02 -0700
  7. Message-Id: <93Jul30.191902pdt.14077-2@well.sf.ca.us>
  8. Date:     Fri, 30 Jul 1993 19:18:35 -0700
  9. From: "Stuart H. Ferguson" <rutgers!well.sf.ca.us!shf>
  10. To: bobsbox.rent.com!lightwave, westford.ccur.com!mark
  11. Subject: Re: Arexx,Modeler
  12.  
  13. +-- Mark Thompson writes:
  14. | I need a script that will take all selected points on screen and turn them
  15. | into single point polygons (particle). If I get a chance, I'll write this one,
  16. | but it might be awhile before I sit down and do it.
  17.  
  18. I wrote this one before release -- specifically for you Mark -- and it
  19. was supposed to be in the shipping version.  Well, if it didn't get in
  20. (sigh), here it is.  Enjoy.
  21.  
  22.         Stuart Ferguson        (shf@well.sf.ca.us)
  23.             Prepare to Surge to Sublight Speed!
  24. -------------------
  25.  
  26. /* CMD: Points to Particles
  27.  *
  28.  * Converts all points into single-point polygons with the default surface.
  29.  * Creates new particles in an empty layer if there is one.  Currently uses
  30.  * all points in the layer, but could be restricted to selected points by
  31.  * setting selection mode to USER.
  32.  *
  33.  * 6/93  Stuart Ferguson
  34.  */
  35.     mxx="LWModelerARexx.port"
  36.     signal on error
  37.     signal on syntax
  38.     mxx_add = addlib(mxx,0)
  39.     call main
  40.     if (mxx_add) then call remlib(mxx)
  41.     exit
  42.  
  43.     syntax:
  44.     error:
  45.     t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
  46.     if (mxx_add) then call remlib(mxx)
  47.     exit
  48.  
  49.  
  50. main:
  51.  
  52. syscode = "Particles"
  53. tmpnam = "t:particles.tmp"
  54.  
  55. /* Use xfrm mode to scan through points, storing coordinates to tmp file.
  56.  */
  57. if (~open(plist, tmpnam, 'W')) then return
  58.  
  59. n = xfrm_begin()
  60. if (n = 0) then do
  61.     call close(plist)
  62.     return
  63. end
  64.  
  65. call meter_begin(n, syscode, "Reading Points")
  66. do i=1 to n
  67.     call writeln(plist, xfrm_getpos(i))
  68.     call meter_step()
  69. end i
  70. call meter_end()
  71. call xfrm_end()
  72.  
  73. call close(plist)
  74.  
  75.  
  76. /* Goto an empty layer.  If none, replace current data.
  77.  */
  78. emp = emptylayers()
  79. if (words(emp) = 0) then call delete()
  80. else call setlayer(word(emp,1))
  81.  
  82.  
  83. /* Read the point coordinates back in and create new data consisting
  84.  * of single-point polygons.
  85.  */
  86. if (~open(plist, tmpnam, 'R')) then return
  87.  
  88. call add_begin()
  89. call meter_begin(n, syscode, "Generating Particles")
  90. do i=1 to n
  91.     call add_polygon add_point(readln(plist))
  92.     call meter_step()
  93. end i
  94. call meter_end()
  95. call add_end()
  96.  
  97. return
  98.  
  99. ---------------- end -----------------